package com.ayf.payment.game.api.controller;

import com.ayf.payment.game.api.dto.MerchantDTO;
import com.ayf.payment.game.api.dto.MerchantPermissionVO;
import com.ayf.payment.game.api.service.MerchantPermissionService;
import com.ayf.payment.game.api.type.CommonConstants;
import com.ayf.payment.game.api.utils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 商户app控制层
 * @Author: zh-liang
 * @Date : 2021-04-15 15:21
 */
@RestController
@RequestMapping("/v/merchant")
public class AppMerchantController {

    @Autowired
    private MerchantPermissionService merchantPermissionService;

    /**
     * 获取账号app权限
     */
    @GetMapping("/getAppPermission")
    public CommonResult<List<MerchantPermissionVO>> getAppPermission(MerchantDTO merchantDTO, @RequestParam("sId") Integer sId) {
        List<MerchantPermissionVO> list = merchantPermissionService.appSonPermissionList(merchantDTO.getId(), merchantDTO.getLoginId(), sId);
        return new CommonResult<>(CommonConstants.RETURN_SUCCESS, "获取成功", list);
    }


}
